package cn.yunhe.controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class HelloWorldController implements Controller {
    @Override
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        ModelAndView modelAndView=new ModelAndView();
        //添加模型数据,可以是任意的POJO对象
        modelAndView.addObject("msg","111hello world ,springMVC!!!");
        //设置逻辑视图名,视图解析器根据改名字解析到具体的视图页面
        modelAndView.setViewName("hello111");
        return modelAndView;
    }
}
